Skip to content

docs: fix C examples in stats/strided/dmeanstdev, dmeanstdevpn and dmeanvar - #16736

Merged
kgryte merged 1 commit into
stdlib-js:developfrom
devxsubh:docs/stats-strided-mean-stdev-var-c-examples
Nov 21, 2026
Merged

kgryte merged 1 commit into
stdlib-js:developfrom
devxsubh:docs/stats-strided-mean-stdev-var-c-examples

Conversation

@devxsubh

Copy link
Copy Markdown
Contributor

Description

What is the purpose of this pull request?

This pull request:

  • fixes the C usage examples in the READMEs of stats/strided/dmeanstdev, stats/strided/dmeanstdevpn and stats/strided/dmeanvar. The _ndarray examples passed x as the output array (..._ndarray( 4, 1.0, x, 2, 0, x, 1, 0 )), so they would overwrite the input instead of writing to out.
  • fixes the stdlib_strided_dmeanstdev example, which read N = 4 elements from a three-element array.

Related Issues

Does this pull request have any related issues?

No.

Reference Packages

Did the content of this pull request follow one or more existing packages? Answering is optional.

This pull request followed these packages:

  • stats/strided/dmeanvarpn

What carried over from the reference(s)?

  • Its README examples, which already pass out and N = 3.

What differed, or what did you have to work out yourself?

  • Nothing.

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

I checked the other stats/strided/[ds]mean{stdev,var}* READMEs for the same two mistakes; these were the only ones.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

Claude Code found these while building stats/strided/smeanstdevpn from dmeanstdevpn, and made the edits. I reviewed the diff myself.


@stdlib-js/reviewers

…d `dmeanvar`

The `_ndarray` examples passed `x` as the output array, and the `dmeanstdev` example read four elements from a three-element array.
@devxsubh
devxsubh requested a review from a team November 20, 2026 19:32
@stdlib-bot stdlib-bot added Statistics Issue or pull request related to statistical functionality. Needs Review A pull request which needs code review. labels Nov 20, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/strided/dmeanstdev $\\color{green}370/370$
$\\color{green}+100.00\\%$
$\\color{green}15/15$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}370/370$
$\\color{green}+100.00\\%$
stats/strided/dmeanstdevpn $\\color{green}374/374$
$\\color{green}+100.00\\%$
$\\color{green}15/15$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}374/374$
$\\color{green}+100.00\\%$
stats/strided/dmeanvar $\\color{green}370/370$
$\\color{green}+100.00\\%$
$\\color{green}15/15$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}370/370$
$\\color{green}+100.00\\%$

The above coverage report was generated for the changes in this PR.

@kgryte kgryte added Documentation Improvements, additions, or changes to documentation. difficulty: 1 Low degree of difficulty. Should be straightforward to implement and/or resolve. review: 5 and removed Needs Review A pull request which needs code review. labels Nov 21, 2026

@kgryte kgryte left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kgryte
kgryte merged commit 60fa32a into stdlib-js:develop Nov 21, 2026
97 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

difficulty: 1 Low degree of difficulty. Should be straightforward to implement and/or resolve. Documentation Improvements, additions, or changes to documentation. review: 5 Statistics Issue or pull request related to statistical functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants